package com.oa.ylms.apps.dao.goods;

import java.util.List;

import com.oa.ylms.apps.entity.goods.GoodCheckValue;
import com.oa.ylms.apps.entity.goods.GoodOrderDetailValue;
import com.oa.ylms.apps.entity.goods.GoodOrderValue;

public interface IGoodsOrderDao {
	/**
	 * 申请物资时，生成物资申请单
	 * 
	 * @param goodOrder
	 * @return
	 * @throws Exception
	 */
	public GoodOrderValue apply(GoodOrderValue goodOrder) throws Exception;



	

	/**
	 * 有审批权限的人登入时，查询需要审批人审批的物资流通单。(条件是流通单的状态等于审批人所在的部门号)
	 * 
	 * @param goodOrder
	 * @return
	 * @throws Exception
	 */
	public List<GoodOrderValue> queryCheckOrder(GoodOrderValue goodOrder,int rows,int pageNo)
			throws Exception;
	public int countCheckOrderTPage(final GoodOrderValue goodOrder,final int rows)throws Exception;
	/**
	 * 查询个人的物资流通单(可根据状态:/全部/正在审批/审批通过/审批失败)
	 * 
	 * @param goodOrder
	 * @return
	 */
	public List<GoodOrderValue> queryPersonalOrder(GoodOrderValue goodOrder,
			int rows, int pageNo);
	public int countPersonalTpages(final GoodOrderValue goodOrder, final int rows)
	throws Exception;
	/**
	 * 审批人员权限：查询审批过的物资流通单
	 * 
	 * @param goodCheck
	 * @return
	 */
	public List<GoodOrderValue> queryCheckOrderByState(GoodCheckValue goodCheck,int rows,int pageNo) throws Exception;
	public int countCheckOrderByStateTPage(GoodCheckValue goodCheck,
			final int rows) throws Exception ;
	/**
	 * 通过某个订单号查询所有订单上的物资列表
	 * 
	 * @param goodOrder
	 * @return List<GoodOrderDetailValue>
	 * @throws Exception
	 */
	public List<GoodOrderDetailValue> queryDetailByOrder(
			GoodOrderValue goodOrder) throws Exception;

	/**
	 * 根据带物资流通单的ID得到整个物资流通单
	 * 
	 * @param goodOrder
	 * @return
	 * @throws Exception
	 */
	public GoodOrderValue queryById(GoodOrderValue goodOrder) throws Exception;

	/**
	 * 更改物资流通单的状态
	 * 
	 * @param goodOrder
	 * @throws Exception
	 */
	public boolean modifyOrderState(GoodOrderValue goodOrder) throws Exception;





	public List<GoodOrderValue> queryReturnOrder();
	public int getNumber();

}
